package cn.wsalix.biz.service.impl;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.anlaser.service.impl.ParentServiceImpl;
import cn.wsalix.biz.entity.Task;
import cn.wsalix.biz.form.TaskForm;
import cn.wsalix.biz.repository.TaskRepository;
import cn.wsalix.biz.service.TaskService;
import cn.anlaser.utils.SearchFilter;
@Service("taskService")
public class TaskServiceImpl extends ParentServiceImpl<TaskForm,TaskRepository,Task> implements TaskService {
	@Autowired
	private TaskRepository taskRepository;

	@Override
	public String module() {
		return "/biz/task";
	}

	@Override
	public TaskRepository getRepository() {
		return taskRepository;
	}

	@Override
	public Class<Task> getEntityClazz() {
		return Task.class;
	}

	@Override
	public Map<String, SearchFilter> buildByForm(TaskForm form) {
		Map<String, Object> searchParams = new HashMap<String, Object>();
		Map<String, SearchFilter> filters = SearchFilter.parse(searchParams);
		/*if (form.getParentId() != null && form.getParentId() != 0) {
			filters.put("parent.id", new SearchFilter("parent.id",
					Operator.EQ, form.getParentId()));
		}*/
		return filters;
	}

}
